﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Masood.Utilities.EmailTemplates.Manager;

namespace Masood.Utilities.EmailTemplates.Facotry
{
    public class TemplateManagerFactory
    {
        public static Manager.AbstractTemplateManager Create(Enum.EnumTemplateType templateType)
        {
            Manager.AbstractTemplateManager manager;
            string siteCollectionUrl = ""; //write your site collection url
            string templateListName = "System Templates"; //update this to match with your environment.

            switch (templateType)
            {
                case Enum.EnumTemplateType.SharePoint:
                    manager = new SharePointTemplateManager(siteCollectionUrl, templateListName);
                    break;

                case Enum.EnumTemplateType.Test:
                    manager = new TestTemplateManager();
                    break;

                default:
                    throw new ArgumentException("Invalid type supplied.");
            }

            return manager;
        }
    }
}
